package com.qlk.odcinterface.dao.impl;

import com.qlk.common.dao.mybatis.BaseDao;
import com.qlk.odcinterface.dao.PmsProductPromotionDao;
import com.qlk.odcinterface.domain.PmsProductPromotion;
import com.qlk.odcinterface.domain.query.PmsProductPromotionQuery;

import java.util.List;
import org.springframework.stereotype.Repository;

/**
 * PmsProductPromotionDAO实现类<br/>
 * 对'单品促销表'表进行基本的操作
 * 
 * @author zhaoyanan
 * @version 2016-4-14 13:22:58
 * 
 */
@Repository
public class PmsProductPromotionDaoImpl extends BaseDao implements PmsProductPromotionDao {
    /** namespace */
    private final String namespace = PmsProductPromotionDaoImpl.class.getName();
    
    /**
     * {@inheritDoc}
     */
    public List<PmsProductPromotion> queryPmsProductPromotionList(PmsProductPromotionQuery queryBean) {
        return (List<PmsProductPromotion>) queryForList(namespace +".queryPmsProductPromotionList", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public boolean insert(PmsProductPromotion pmsProductPromotion) {
        return insert(namespace +".insert", pmsProductPromotion);
    }

    /**
     * {@inheritDoc}
     */
    public boolean update(PmsProductPromotion pmsProductPromotion) {
        return update(namespace +".update", pmsProductPromotion);
    }

    /**
     * {@inheritDoc}
     */
    public int queryPmsProductPromotionCount(PmsProductPromotionQuery queryBean) {
        return (Integer) queryForObject(namespace +".queryPmsProductPromotionCount", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public List<PmsProductPromotion> queryPmsProductPromotionListWithPage(PmsProductPromotionQuery queryBean) {
        return (List<PmsProductPromotion>) queryForList(namespace +".queryPmsProductPromotionListWithPage", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public boolean delete(PmsProductPromotion configuration) {
        return delete(namespace +".delete", configuration);
    }
    
    /**
     * {@inheritDoc}
     */
    public PmsProductPromotion getPmsProductPromotionById(Integer id) {
        return (PmsProductPromotion) queryForObject(namespace +".getPmsProductPromotionById", id);
    } 
    
    /**
     * {@inheritDoc}
     */
    public boolean exist(PmsProductPromotion pmsProductPromotion) {
        int count = (Integer) queryForObject(namespace +".exist", pmsProductPromotion);
        return count > 0;
    }
}
